<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dth">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript"
	src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
input[type=checkbox] {
	width: 15px
}

.gn_name {
	padding-top: 8px
}

select {
	width: 234px;
	height: 31px
}

.gn_name {
	padding-top: 5px
}

.div_zilei {
	width: 430px;
	padding-left: 210px;
	height: 30px;
	text-align: right;
	margin-bottom: 20px
}

.tr {
	height: 40px;
	background: #a9bbe0
}

.tr td {
	font-size: 14px;
	color: #ffffff
}

.tr_td {
	height: 40px;
}

.tr_td td {
	border-bottom: 1px solid #ededed;
	text-align: center;
}

tr td:nth-child(1) {
	font-size: 14px;
	color: #cccccc
}

.date {
	border: 0;
	background: #ffffff;
	text-align: center;
}

.tr_td td:nth-child(1) {
	border-left: 1px solid #cccccc;
}

.tr_td td:nth-child(3) {
	border-right: 1px solid #cccccc;
}

.addTable.deleteTable:HOVER {
	cursor: pointer;
}

.fseq {
	width: 20px;
	border: 0;
	text-align: center;
	color: #cccccc;
	overflow: hidden;
	padding-left: 10px
}

#table1 {
	min-height: 40px;
	border-spacing: 0;
	padding-left: 100px;
	margin-bottom: 20px;
	width: auto;
}
.div_input {
	width: 500px;
	height: 40px;
}
</style>
<body style="background: #f5f5f5">
	<div class="main">
		<div id="modal-overlay"></div>
		<div class="modal-data2">
			<div style="height: 60px">
				<ul>
					<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
						<span>名称：</span> <span> <input class="name" type="text">
					</span> <span>
							<button class="findBtn2">查询</button>
					</span>
					</li>
				</ul>
			</div>
			<div style="width: 100%; height: 350px; overflow: scroll;">
				<form action="">
					<table class="head2"
						style="width: auto; white-space: nowrap; border-spacing: 0px">
						<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
							class="sel">
							<td style="width: 20px"></td>
							<td>员工编号</td>
							<td>员工姓名</td>
							<td>部门</td>
							<td>员工类型</td>
							<td>身份证号码</td>
							<td>手机号码</td>
							<td>地址</td>
							<td>出生日期</td>
							<td>入职日期</td>
							<td>转正日期</td>
							<td>离职日期</td>
							<td>合同到期日</td>
							<td>社保编号</td>
							<td>车辆</td>
							<td>性别</td>
							<td>职级职等</td>
							<td>薪酬调整</td>
							<td>岗位异动</td>
							<td>请假记录</td>
							<td>违纪奖励记录</td>
							<td>社会保险记录</td>
							<td>计算招生提成</td>
							<td>计算培训提成</td>
						</tr>
						<c:forEach items="${persons}" var="persons" varStatus="s">
							<tr style="margin-top: 45px" class="jx">
								<td><input type="checkbox" class="check"
									value="${persons.fid}" name="train" /></td>
								<td>${persons.fnumber}</td>
								<td>${persons.fnameL2}</td>
								<td>${persons.cfpersondepName}</td>
								<c:if test="${empty persons.cfpersontype}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfpersontype == '0'}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfpersontype == '1'}">
									<td>办公室职员</td>
								</c:if>
								<c:if test="${persons.cfpersontype == '2'}">
									<td>教练</td>
								</c:if>
								<c:if test="${persons.cfpersontype == '3'}">
									<td>其他</td>
								</c:if>
								<td>${persons.cfidcardno}</td>
								<td>${persons.cfcell}</td>
								<td>${persons.cfaddress}</td>
								<td>${persons.cfbirthdays}</td>
								<td>${persons.cfbegindate}</td>
								<td>${persons.cfstartdate}</td>
								<td>${persons.cfenddate}</td>
								<td>${persons.cfhtdqsj}</td>
								<td>${persons.cfaccountsno}</td>
								<td>${persons.cfcarName}</td>
								<c:if test="${empty persons.cfsex}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfsex == '1'}">
									<td>男</td>
								</c:if>
								<c:if test="${persons.cfsex == '2'}">
									<td>女</td>
								</c:if>
								<td>${persons.positiongradeName}</td>
								<td>${persons.cfxctz}</td>
								<td>${persons.cfgwyd}</td>
								<td>${persons.cfqjjl}</td>
								<td>${persons.cfwjjljl}</td>
								<td>${persons.cfshjljl}</td>
								<c:if test="${empty persons.cfzstc}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfzstc == '0'}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfzstc == '1'}">
									<td><input type="checkbox" disabled="disabled"
										checked="checked"></td>
								</c:if>
								<c:if test="${empty persons.cfpxtc}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfpxtc == '0'}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfpxtc == '1'}">
									<td><input type="checkbox" disabled="disabled"
										checked="checked"></td>
								</c:if>
							</tr>
						</c:forEach>
					</table>

					<input type="hidden" class="type">
				</form>
			</div>
			<button class="subtn2"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
				确定</button>
			<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
				关闭</button>
		</div>

		<div class="modal-data1">
			<div style="height: 60px">
				<ul>
					<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
						<span>名称：</span> <span> <input class="name1" type="text">
					</span> <span>
							<button class="findBtn1">查询</button>
					</span>
					</li>
				</ul>
			</div>
			<div style="width: 100%; height: 350px; overflow: scroll;">
				<form action="">
					<table class="head1"
						style="width: auto; white-space: nowrap; border-spacing: 0px">
						<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
							class="sel">
							<td style="width: 20px"></td>
							<td>名称</td>
							<td>编码</td>
							<td>简称</td>
							<td>描述</td>
							<td>创建时间</td>
							<td>用户名</td>
							<td>最后修改时间</td>
							<td>用户名</td>
							<td>财务组织</td>
							<td>科目</td>
							<td>队长</td>
						</tr>
					</table>
				</form>
			</div>
			<button class="subtn1"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
				确定</button>
			<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
				关闭</button>
		</div>

		<c:if test="${empty coaceGroup}">
			<div class="weizhi">职员基础资料>>教练组>>新增</div>
		</c:if>
		<c:if test="${not empty coaceGroup}">
			<div class="weizhi">职员基础资料>>教练组>>修改</div>
		</c:if>
		<div class="div_body" style="box-shadow: 0 0 5px #cccccc;">
			<div class="div_form">
				<c:if test="${empty coaceGroup}">
					<form action="<%=path%>/DrivingSys/addCoaceGroup" class="form" onsubmit="return submit2();">
						<div class="fwrz">
							<div class="div_input">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span> <input type="text"
									readonly="readonly" value="${department.fnameL2}"
									style="color: gray;">
							</div>
							<div class="div_input">
								<span class="gn_name">编码&nbsp;:&nbsp;</span> <input type="text"
									name="fnumber" value="${fnumber}" readonly="readonly"
									style="color: gray;">
							</div>
							<div class="div_input">
								<span class="gn_name">名称&nbsp;:&nbsp;</span> <input type="text"
									name="fnameL2" class="name2">
								<span class="required">必填</span>
							</div>
							<div class="div_input">
								<span class="gn_name">组长&nbsp;:&nbsp;</span> <input type="text"
																					id="coaceGroup" class="is_click_ne">
								<input type="hidden" name="cfpersonid"
									   id="groupName">
							</div>
							<div class="div_input">
								<span class="gn_name">教练队&nbsp;:&nbsp;</span> <input type="text"
																					 name="teamName2" id="teamName2"
																					 class="is_click_ne"> <input
									type="hidden"
									name="cfteamid" id="teamName">
							</div>
							<div class="div_input">
								<span class="gn_name">队长&nbsp;:&nbsp;</span> <input type="text"
																					name="duichangName2"
																					id="duichangName2"
																					class="is_click_ne"> <input
									type="hidden" name="cfduizhangid" id="duichangName">
							</div>
							<div class="div_input">
								<span class="gn_name">科目&nbsp;:&nbsp;</span> <select
									name="cfkemu" style="width: 234px; height: 31px">
									<option value="1">科目一</option>
									<option value="2">科目二</option>
									<option value="3">科目三</option>
								</select>
							</div>

							<div class="div_zilei" style="margin-bottom: 0px;">
								<div style="width: 280px; text-align: right;">
									<img src="<%=path%>/image/insert2323.jpg" class="addTable">
									<span
										style="padding-right: 20px; color: #a9bbe0; font-size: 14px"
										class="addTable">添加</span> <img
										src="<%=path%>/image/delete212.png" class="deleteTable">
									<span class="deleteTable"
										style="color: #a9bbe0; font-size: 14px" class="deleteTable">删除</span>
								</div>
							</div>
							<div
								style="overflow: auto; height: 200px; width: 30%; padding-left: 40px;">
								<table id="table1" >
									<tr class="tr">
										<td width="20px"></td>
										<td width="20px"></td>
										<td width="300px" align="center">教练</td>
									</tr>
								</table>
							</div>
						</div>
						<div class="div_tj" style="margin-left: 140px">
							<div>
								<input type="submit" class="input_submit bc" value="" style="margin-top:0px;margin-right: 30px;"/>
							</div>
							<div>
								<input type="button" class="input_back fh" value=""
									   onclick="back()" style="margin-top:0px;"/>
							</div>
						</div>
					</form>
				</c:if>
				<c:if test="${not empty coaceGroup}">
					<form action="<%=path%>/DrivingSys/modifyCoaceGroup" class="form" onsubmit="return submit2();">
						<div class="fwrz">
							<div class="div_input">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span> <input type="text"
									readonly="readonly" value="${department.fnameL2}"
									style="color: gray;">
									<input type="hidden" name="fid" value="${coaceGroup.fid}">
							</div>
							<div class="div_input">
								<span class="gn_name">编码&nbsp;:&nbsp;</span> <input type="text"
									name="fnumber" value="${coaceGroup.fnumber}"
									readonly="readonly" style="color: gray;">
							</div>
							<div class="div_input">
								<span class="gn_name">名称&nbsp;:&nbsp;</span> <input type="text"
									name="fnameL2" value="${coaceGroup.fnameL2}" class="name2">
								<span class="required">必填</span>
							</div>
							<div class="div_input">
								<span class="gn_name">组长&nbsp;:&nbsp;</span> <input type="text"
																					id="coaceGroup"
																					value="${coaceGroup.groupName}"
																					class="is_click_ne"> <input
									type="hidden" name="cfpersonid" id="groupName"
									value="${coaceGroup.cfpersonid}">
							</div>
							<div class="div_input">
								<span class="gn_name">教练队&nbsp;:&nbsp;</span> <input type="text"
																					 name="teamName2" id="teamName2"
																					 value="${coaceGroup.teamName}"
																					 class="is_click_ne">
								<input type="hidden" name="cfteamid" id="teamName"
									value="${coaceGroup.cfteamid}">
							</div>
							<div class="div_input">
								<span class="gn_name">队长&nbsp;:&nbsp;</span> <input type="text"
																					name="duichangName2" id="duichangName2"
																					value="${coaceGroup.duichangName}"
																					class="is_click_ne"> <input
									type="hidden" name="cfduizhangid" id="duichangName"
									value="${coaceGroup.cfduizhangid}">
							</div>
							<div class="div_input">
								<span class="gn_name">科目&nbsp;:&nbsp;</span> <select
									name="cfkemu" style="width: 234px; height: 31px">
									<c:if test="${coaceGroup.cfkemu == '1'}">
										<option value="1">科目一</option>
										<option value="2">科目二</option>
										<option value="3">科目三</option>
									</c:if>
									<c:if test="${coaceGroup.cfkemu == '2'}">
										<option value="2">科目二</option>
										<option value="1">科目一</option>
										<option value="3">科目三</option>
									</c:if>
									<c:if test="${coaceGroup.cfkemu == '3'}">
										<option value="3">科目三</option>
										<option value="1">科目一</option>
										<option value="2">科目二</option>
									</c:if>
								</select>
							</div>

							<div class="div_zilei" style="margin-bottom: 0px;">
								<div style="width: 280px; text-align: right;">
									<img src="<%=path%>/image/insert2323.jpg" class="addTable">
									<span
										style="padding-right: 20px; color: #a9bbe0; font-size: 14px"
										class="addTable">添加</span> <img
										src="<%=path%>/image/delete212.png" class="deleteTable">
									<span class="deleteTable"
										style="color: #a9bbe0; font-size: 14px" class="deleteTable">删除</span>
								</div>
							</div>
							<div
								style="overflow: auto; height: 200px; width: 45%; padding-left: 40px;">
								<table id="table1">
									<tr class="tr">
										<td width="20px"></td>
										<td width="20px"></td>
										<td width="300px" align="center">教练</td>
									</tr>
									<c:forEach items="${coaceGroupEntrys}" var="coaceGroupEntrys">
										<tr align="left" class="tr_td">
										<td><input type="checkbox" name="check" style="width: 15px"></td>
											<td><input type="text" readonly="readonly" name="fseq"
												class="fseq" value="${coaceGroupEntrys.fseq}" /></td>
											<td>
												<input type="text" class="person is_click_ne"
													   onclick="coaceGroup2($(this))"
													   id="jx${coaceGroupEntrys.fseq}"
													   value="${coaceGroupEntrys.coaceName}"/>
											<input type='hidden' name='cfpersonid2' value="${coaceGroupEntrys.cfpersonid}"/></td>
										</tr>
									</c:forEach>
								</table>
							</div>
						</div>
						<div class="div_tj" style="margin-left: 140px">
								<div>
									<input type="submit" class="input_submit bc" value="" style="margin-top:0px;margin-right: 30px;">
								</div>
								<div>
									<input type="button" class="input_back fh" value=""
										   onclick="back()" style="margin-top:0px;"/>
								</div>
						</div>
					</form>
				</c:if>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript">


$(document).ready(function(){
	var type = "${type}"
	if(type == null || type == ''){
		
	}else{
        editAlert();
	}
})

var _this;
//自动表格
$(".addTable").click(function(){
	 var tr_len = $("#table1 tr").length;//表格长度
	 var str = "<tr align='left' class='tr_td'><td><input type='checkbox' name='check' style='width: 15px'></td><td><input type='text' name='fseq' class='fseq' value="+tr_len+" readonly='readonly'></td>";
    str += "<td><input type='text' class='person is_click_ne' onclick='coaceGroup2($(this))' id='jx" + tr_len + "'/><input type='hidden' name='cfpersonid2'/></td></tr>"
	 $("#table1").append(str)
})

//删除一行
$(".deleteTable").click(function(){
	var tr_len = $("#table1 tr").length;
	if(tr_len == 1){
		
	}else{
		var s;
		$('input:checkbox[name=check]').each(function(i) {
			if($(this).is(':checked')){
				$(this).parent().parent().remove();
				s = '1';
			}
		})
		
		//判断是否选中
		if(s == null || s == ''){
			alert("请选择一条数据删除");
			return false;
		}
		//重新排序
		$('#table1 tr td .fseq').each(function(i) {
			var s = i*1 + 1*1;
			$(this).val(s);
			$(this).parent().next().find("input").attr("id",'jx'+s);
		})
	}
})
	
//组长显示职员信息
$('#coaceGroup').click(function(){
	$(".type").val("zuchang");
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data2').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
})

//队长显示职员信息
$('#duichangName2').click(function(){
	$(".type").val("duichang");
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data2').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
})

//教练显示职员信息
function coaceGroup2(_this){
	var id = _this.parent().parent().find(".fseq").val();
	$(".type").val(id);
	var ss = _this;
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data2').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
}
	
//取消
$('.btn').click(function(){
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data2').css('visibility','hidden')
	$('.modal-data1').css('visibility','hidden')
	$('input:checkbox').removeAttr('checked');
})

//根据名称查询
$(".findBtn2").click(function(){
	var name = $(".name").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/quePersonByName', 
	    type: "post",
	    data:{'name':name},
	    dataType:"json",
	    success:function(json){
	    	data(json,2)
	    },  
			error: function(){alert('Error');} 
	})
})

//选择数据
$(".subtn2").click(function(){
	var type = $(".type").val();
	var fid = "";
		$('input:checkbox[name=train]').each(function(i){
		    if(0==i){
		    	  fid = $(this).val();
		    }
	      });  	
	      if(fid==""){
	    	  alert("请选择一条数据")
	    	  return false
	      }else{
			  $.ajax({
					url:'<%=path%>/DrivingSys/quePersonByFid',
					type : "post",
					data : {'fid' : fid},
					dataType : "json",
					success : function(json) {
						if(type == 'zuchang'){
							$("#coaceGroup").val(json.fnameL2)
							$("#groupName").val(fid)
						}else if(type == 'duichang' ){
							$("#duichangName2").val(json.fnameL2)
							$("#duichangName").val(fid)
						}else{
							$('#jx'+type+'').val(json.fnameL2);
							$('#jx'+type+'').next().val(json.fid);
						}
				},
				error : function() {
					alert('Error');
				}
			})
			
		}
		$('#modal-overlay').css('visibility', 'hidden')
		$('.modal-data2').css('visibility', 'hidden')
		$('.modal-data1').css('visibility', 'hidden')
});
//双击确定
$(document).on('dblclick','.jx td',function(){
	var type = $(".type").val();
	 var fid = $(this).parent().find("input[name=train]").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/quePersonByFid',
		type : "post",
		data : {'fid' : fid},
		dataType : "json",
		success : function(json) {
		if(type == 'zuchang'){
				$("#coaceGroup").val(json.fnameL2)
				$("#groupName").val(fid)
		}else if(type == 'duichang' ){
				$("#duichangName2").val(json.fnameL2)
				$("#duichangName").val(fid)
		}else{
				$('#jx'+type+'').val(json.fnameL2);
				$('#jx'+type+'').next().val(json.fid);
		}
		},
		error : function() {
			alert('错误');
		}
	})
		$('#modal-overlay').css('visibility', 'hidden')
		$('.modal-data2').css('visibility', 'hidden')
		$('.modal-data1').css('visibility', 'hidden')
	
})

$("#teamName2").click(function(){
	$.ajax({
		url:'<%=path%>/DrivingSys/queTeam',
		type : "post",
		dataType : "json",
		success : function(json) {
			team(json);
		},
		error : function() {
			alert('Error');
		}
	})
	
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data1').css('visibility','visible')
	$('input:checkbox').removeAttr('checked');
})
//阻止表单提交
function submit2(){
	var name = $(".name2").val();
	if(name == null || name == ''){
		alert("名称不能未空")
		return false
	}
    //提交后把提交变成不可用，可阻止表单重复提交
    $("input[type='submit']").attr("disabled", "disabled");
}

//根据名称查询
$(".findBtn1").click(function(){
	var name = $(".name1").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/queTeam', 
	    type: "post",
	    data:{'name':name},
	    dataType:"json",
	    success:function(json){
	    	team(json)
	    },  
			error: function(){alert('Error');} 
	})
})

//选择数据
$(".subtn1").click(function(){
	var fid = "";
		$('input:checkbox:checked').each(function(i){
		    if(0==i){
		    	   fid = $(this).val();
		    }
	      });  	
	      if(fid==""){
	    	  alert("请选择一条数据")
	    	  return false
	      }else{
			  $.ajax({
				url:'<%=path%>/DrivingSys/queTeamByFid',
				type : "post",
				data : {
					'fid' : fid
				},
				dataType : "json",
				success : function(json) {
					$("#teamName2").val(json.fnameL2)
					$("#teamName").val(json.fid)
				},
				error : function() {
					alert('Error');
				}
			})

		}
		$('#modal-overlay').css('visibility', 'hidden')
		$('.modal-data2').css('visibility', 'hidden')
		$('.modal-data1').css('visibility', 'hidden')
	});
	
//双击确定
$(document).on('dblclick','.jld td',function(){
	var fid = $(this).parent().find("input[name=train2]").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/queTeamByFid',
		type : "post",
		data : {
			'fid' : fid
		},
		dataType : "json",
		success : function(json) {
			$("#teamName2").val(json.fnameL2)
			$("#teamName").val(json.fid)
		},
		error : function() {
			alert('错误');
		}
	})
	$('#modal-overlay').css('visibility', 'hidden')
	$('.modal-data2').css('visibility', 'hidden')
	$('.modal-data1').css('visibility', 'hidden')
	
})	

	//教练队
	function team(json) {
		var str = ''
		for (var i = 0; i < json.length; i++) {
			str += '<tr style="margin-top: 45px;height: 30px;" class="jld"><td><input style="width: 15px;height: 15px" '
  	         str+='type="checkbox" name="train2"  value="'+json[i].fid+'"></td>'
			if (json[i].fnameL2 == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fnameL2 + '</td>'
			}
			if (json[i].fnumber == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fnumber + '</td>'
			}
			if (json[i].fsimplename == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fsimplename + '</td>'
			}
			if (json[i].fdescriptionL2 == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fdescriptionL2 + '</td>'
			}
			if (json[i].fcreatetime == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fcreatetime + '</td>'
			}
			if (json[i].createName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].createName + '</td>'
			}
			if (json[i].flastupdatetime == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].flastupdatetime + '</td>'
			}
			if (json[i].updateName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].updateName + '</td>'
			}
			if (json[i].companyName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].companyName + '</td>'
			}
			if (json[i].cfkemu == '1') {
				str += '<td>科目一</td>'
			} else if (json[i].cfkemu == '2') {
				str += '<td>科目二</td>'
			} else {
				str += '<td>科目三</td>'
			}
			if (json[i].teamName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].teamName + '</td>'
			}
			str += '</tr>';
		}
		$(".head1 tr:not(':first')").remove()
		$('.head1').append(str)
	}

	//职员数据
	function data(json, args) {
		var str = ''
		for (var i = 0; i < json.length; i++) {
			str += '<tr style="margin-top: 45px;height: 30px;"  class="jx"><td><input style="width: 15px;height: 15px" '
  	         str+='type="checkbox" name="train"  value="'+json[i].fid+'"></td>'
			if (json[i].fnumber == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fnumber + '</td>'
			}
			if (json[i].fnameL2 == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].fnameL2 + '</td>'
			}
			if (json[i].cfpersondepName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfpersondepName + '</td>'
			}
			if (json[i].cfpersontype == '1') {
				str += '<td>办公室职员</td>'
			} else if (json[i].cfpersontype == '2') {
				str += '<td>教练</td>'
			} else if (json[i].cfpersontype == '3') {
				str += '<td>其他</td>'
			} else {
				str += '<td></td>'
			}
			if (json[i].cfidcardno == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfidcardno + '</td>'
			}
			if (json[i].cfcell == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfcell + '</td>'
			}
			if (json[i].cfaddress == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfaddress + '</td>'
			}
			if (json[i].cfbirthdays == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfbirthdays + '</td>'
			}
			if (json[i].cfbegindate == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfbegindate + '</td>'
			}
			if (json[i].cfstartdate == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfstartdate + '</td>'
			}
			if (json[i].cfenddate == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfenddate + '</td>'
			}
			if (json[i].cfhtdqsj == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfhtdqsj + '</td>'
			}
			if (json[i].cfhtdqsj == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfaccountsno + '</td>'
			}
			if (json[i].cfcarName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfcarName + '</td>'
			}
			if (json[i].cfsex == '1') {
				str += '<td>男</td>'
			} else if (json[i].cfsex == '2') {
				str += '<td>女</td>'
			} else {
				str += '<td></td>'
			}
			if (json[i].positiongradeName == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].positiongradeName + '</td>'
			}
			if (json[i].cfxctz == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfxctz + '</td>'
			}
			if (json[i].cfgwyd == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfgwyd + '</td>'
			}
			if (json[i].cfqjjl == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfqjjl + '</td>'
			}
			if (json[i].cfwjjljl == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfwjjljl + '</td>'
			}
			if (json[i].cfshjljl == null) {
				str += '<td></td>'
			} else {
				str += '<td>' + json[i].cfshjljl + '</td>'
			}
			if (json[i].cfzstc == '0') {
				str += '<td><input type="checkbox" disabled="disabled"></td>'
			} else if (json[i].cfzstc == '1') {
				str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
			} else {
				str += '<td><input type="checkbox" disabled="disabled"></td>'
			}
			if (json[i].cfpxtc == '1') {
				str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
			} else {
				str += '<td><input type="checkbox" disabled="disabled"></td>'
			}
			str += '</tr>';
		}
		if (args == '2') {
			$(".head2 tr:not(':first')").remove()
			$('.head2').append(str)
		} else {
			$(".head1 tr:not(':first')").remove()
			$('.head1').append(str)
		}
	}

	//单击选中职员
	$(".jx td").live('click',function(){
	    $('input:checkbox[name=train]:checked').each(function(i) {
	    	$(this).removeAttr("checked");
	     });
	     $(this).parent().find("input:checkbox").attr('checked','checked');
	}) 
	//单击选中教练队
	$(".jld td").live('click',function(){
	    $('input:checkbox[name=train2]:checked').each(function(i) {
	    	$(this).removeAttr("checked");
	     });
	     $(this).parent().find("input:checkbox").attr('checked','checked');
	}) 
	function back(){
        parent.closeSelectCard()
		//location = '<%=path%>/DrivingSys/queryCoaceGroup/look.action';
	}
</script>
</html>